<template>
	<view>
		<view>
			<u-navbar :is-back="false" title="个人中心">
			</u-navbar>
			
			<u-popup v-model="updateUserShow" mode="bottom" width="100%" height="95%" :closeable="true">
				<h2 style="margin-top: 80rpx;margin-left: 20rpx;">账户设置</h2>
				<u-row gutter="16">
					<u-col span="2">
						<view class="u-avatar-wrap">
							<u-avatar :src="headImg" size="80" @click="upload()"></u-avatar>
						</view>
					</u-col>
					<u-col span="10">
						<view class="u-avatar-wrap">
							<h4>更改头像</h4>
						</view>
					</u-col>
				</u-row>
				
				<u-row gutter="16">
					更改昵称
					<u-col span="12">
						<u-input placeholder="昵称" v-model="nickname" type="text" :border="true" />
					</u-col>
				</u-row>
				<u-row gutter="16">
					更改手机号码
					<u-col span="12">
						<u-input placeholder="手机号码" v-model="phone" type="text" :border="true" />
					</u-col>
				</u-row>
				<u-row gutter="16">
					<u-col span="6">
					</u-col>
					<u-col span="5">
						<view class="demo-layout bg-purple-light">
							<u-button type="primary" :ripple="true" @click="updateUser()">
								确认修改
							</u-button>
						</view>
					</u-col>
				</u-row>
				
				<u-row gutter="16">
					请输入旧密码
					<u-col span="12">
						<u-input placeholder="密码" v-model="password" type="text" :border="true" />
					</u-col>
				</u-row>
				<u-row gutter="16">
					请输入新密码
					<u-col span="12">
						<u-input placeholder="密码" v-model="newPassword1" type="text" :border="true" />
					</u-col>
				</u-row>
				<u-row gutter="16">
					请确认新密码
					<u-col span="12">
						<u-input placeholder="密码" v-model="newPassword2" type="text" :border="true" />
					</u-col>
				</u-row>
				<u-row gutter="16">
					<u-col span="6">
					</u-col>
					<u-col span="5">
						<view class="demo-layout bg-purple-light">
							<u-button type="primary" :ripple="true" @click="updatePassword()">
								确认修改
							</u-button>
						</view>
					</u-col>
				</u-row>
			</u-popup>
			
			<u-popup v-model="verShow" mode="bottom" width="100%" height="95%" :closeable="true">
				<h2 style="margin-top: 80rpx;margin-left: 20rpx;margin-bottom: 20rpx;">版本信息</h2>
				<h4 style="text-align: center;background-color: #2979ff;color: #FFFFFF; ">当前版本</h4>
				<u-cell-group style="margin-bottom: 100rpx;">
					<u-cell-item title="版本号" :arrow="false">{{L_appVer}}</u-cell-item>
					<u-cell-item title="版本信息" :arrow="false">{{L_verContent}}</u-cell-item>
					<u-cell-item title="更新时间" :arrow="false">{{L_createTime}}</u-cell-item>
				</u-cell-group>
				
				<h4 style="text-align: center;background-color: #2979ff;color: #FFFFFF; ">最新版本</h4>
				<u-cell-group>
					<u-cell-item title="版本号" :arrow="false">{{appVer}}</u-cell-item>
					<u-cell-item title="版本信息" :arrow="false">{{verContent}}</u-cell-item>
					<u-cell-item title="更新时间" :arrow="false">{{createTime}}</u-cell-item>
				</u-cell-group>
				
				<u-button type="primary" style="margin: 100rpx;" :disabled="isUpdateApp">更新</u-button>
			</u-popup>

			<u-row gutter="16">
				<u-col span="2">
					<view class="demo-layout bg-purple">
						<u-avatar :src="headImg" size="100" @click="gotoUser()"></u-avatar>
					</view>
				</u-col>
				<u-col span="10">
					<view class="demo-layout bg-purple">
						<h3>{{nickname}}</h3>
						<h4>{{id}}</h4>
					</view>
				</u-col>
			</u-row>
			<u-cell-group>
				<u-cell-item icon="setting" title="账户设置" @click="update()"></u-cell-item>
				<u-cell-item icon="bookmark" title="版本信息" @click="ver()"></u-cell-item>
				<u-cell-item icon="close-circle" title="退出登录" @click="returnLogin()"></u-cell-item>
			</u-cell-group>
		</view>
		<u-tabbar v-model="current" :list="downList" :mid-button="false" :before-switch="beforeSwitch"></u-tabbar>
	</view>
</template>

<script src="./user.js">
	
</script>

<style src="./user.css">
	
</style>
